﻿#region References

using System.Collections.Generic;
using System.Linq;
using Data.Model;
using Data.Repositories.Users;

#endregion

namespace Data.Repositories.AppUsers
{
    internal class AppUsersRepository : UsersRepository, IAppUsersRepository
    {
        internal AppUsersRepository()
        {
            Load();
        }

        public new IEnumerable<AppUser> CachedObjects
        {
            get { return base.CachedObjects.OfType<AppUser>(); }
        }

        #region IAppUsersRepository Members

        public void Save(AppUser appUser)
        {
            DomainContext.Users.AddObject(appUser);
            SaveChanges();
            RefreshCache();
        }

        #endregion
    }
}